import { Suspense } from 'react';
import PageLoading from './PageLoading';

const LazyComponent = (props) => {
  const { component: Component } = props;
  return (
    <Suspense fallback={<PageLoading />}>
      <Component />
    </Suspense>
  );
};

export default LazyComponent;
